//
//  NSDate+Medthod.h
//  CloudCar
//
//  Created by TNG on 2018/2/5.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSDate (Medthod)

@property (nonatomic, readonly) NSInteger year;
@property (nonatomic, readonly) NSInteger month;
@property (nonatomic, readonly) NSInteger day;
@property (nonatomic, readonly) NSInteger hour;
@property (nonatomic, readonly) NSInteger minute;
@property (nonatomic, readonly) NSInteger second;
@property (nonatomic, readonly) BOOL isToday;

/** 当前时间延迟years年*/
- (nullable NSDate *)dateByAddingYears:(NSInteger)years;
/** 当前时间延迟months月*/
- (nullable NSDate *)dateByAddingMonths:(NSInteger)months;
/** 当前时间延迟days天*/
- (nullable NSDate *)dateByAddingDays:(NSInteger)days;
/** 当前时间延迟hours时*/
- (nullable NSDate *)dateByAddingHours:(NSInteger)hours;
/** 当前时间延迟minutes分*/
- (nullable NSDate *)dateByAddingMinutes:(NSInteger)minutes;
/** 当前时间延迟seconds秒*/
- (nullable NSDate *)dateByAddingSeconds:(NSInteger)seconds;

+ (NSDate *_Nullable)stringToDate:(NSString *_Nullable)str format:(NSString *_Nullable)formatStr;
+ (NSString *_Nullable)compareCurrentTime:(NSDate *_Nullable)compareDate;
+ (BOOL)ifIsOverDateCompareCurrentDate:(NSString *_Nullable)dateString dateFormat:(NSString *_Nullable)format;

@end
